<?php
//open ss
//add class data
//creat $p-> 
session_start();
include "../mrga.php";
$p=new data();
// code kiểm tra đăng nhập trả về true
// if(kt=true){thực hiện insert}

$lv=$_POST["j_lv"];
if($lv!=0)
{
	$tm=$p->query("SELECT *  FROM tb_menu_product where id='$lv'",'name');
	$tm="con của thư muc ".$tm;
}
else
{
	$tm="gốc";
}

		$link=$p->con();
		$sql="SELECT *  FROM tb_menu_product where parent='$lv' ORDER BY id DESC";
		$kq=mysql_query($sql,$link);	
		echo'<span id="mga_ct_name_tc_list_pro" style="color:#FFF;">Thư mục '.$tm.'</span><br/>';	
		while($rows=mysql_fetch_array($kq))
		{
			$id=$rows['id'];
			$ten=$rows['name'];
			$cap=$rows['parent'];
			echo '
			<input type="text" id="mga_ipt_ud_list_pro_id" value="'.$ten.'" size="25"/>			
			<button id="mga_btn_dl_list_pro_'.$id.'"><img src="../public/images/admin/-.png" width="18" height="18" /></button>
			<br/>			
			';
		}
		$p->dis();
		//
		echo'		
		<button id="mga_btn_int_list_pro_'.$lv.'" ><img src="../public/images/admin/+.png" width="18" height="18" /></button>
		';
?>